package com.chenwc.util.translate.google.oauth2;

import com.chenwc.util.translate.google.LoadGooglePropertiesFile;

import java.io.File;
import java.util.Properties;

/**
 * 常量
 *
 * @author chenwc
 * @date 2024/7/30
 */
public class Oauth2Constant {

    private static final Properties PROPERTIES = LoadGooglePropertiesFile.loadGooglePropertiesFile();

    /**
     * scope: 将要使用的API所需要对应指定的范围
     */
    public static final String GOOGLE_OAUTH2_SCOPE_URL = PROPERTIES.getProperty("GOOGLE_OAUTH2_SCOPE_URL");
    /**
     * 在Google Developer Console做成的服务账号即clientID
     */
    public static final String GOOGLE_OAUTH2_CLIENT_ID = PROPERTIES.getProperty("GOOGLE_OAUTH2_CLIENT_ID");
    /**
     * 发行访问令牌的目标网址
     */
    public static final String GOOGLE_OAUTH2_AUD_URL = PROPERTIES.getProperty("GOOGLE_OAUTH2_AUD_URL");

    /**
     * private_key: 私钥id
     */
    public static final String PRIVATE_KEY_ID = PROPERTIES.getProperty("PRIVATE_KEY_ID");

    /**
     * token_url: 获取token的url
     */
    public static final String GOOGLE_TOKEN_URL = PROPERTIES.getProperty("GOOGLE_TOKEN_URL");

    /**
     * 认证token前缀
     */
    public static final String TOKEN_PREFIX = PROPERTIES.getProperty("TOKEN_PREFIX") + " ";

    private static final File FILE = new File("1.txt");

    /**
     * keystore_path: jks密钥库路径
     */
    public static final String KEYSTORE_PATH = FILE.getAbsolutePath().replace("1.txt", "") + PROPERTIES.getProperty("KEYSTORE_PATH");

}
